package qq.longin;

import javax.swing.*;
import java.awt.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-05-17
 * Time：11:26
 */
public class MyFrame extends JFrame {
    JPanel jp1,jp2,jp3;
    JLabel jl1,jl2,jl3,jl4,jl5;
    JTextField jtf;
    JPasswordField jpf;
    JButton jt1,jt2;

    public  MyFrame() {
        jp1=new JPanel();
        jp2=new JPanel();
        jp3=new JPanel();

        jl1=new JLabel(new ImageIcon("images//tou.jpg"));
        jl2=new JLabel("QQ账号：",JLabel.CENTER);
        jl3=new JLabel("QQ密码：",JLabel.CENTER);

        jl4=new JLabel("<html><a herf='www.qq.com'>申请密码</a></html>",JLabel.CENTER);
        jl5=new JLabel("<html><a herf='www.qq.com'>忘记密码</a></html>",JLabel.CENTER);
        jpf=new JPasswordField(15);
        jtf=new JTextField(15);

        jt1=new JButton("登入");
        jt2=new JButton("取消");

        jp2.setLayout(new GridLayout(2,3,0,5));
        jp1.add(jl1);
        jp2.add(jl2);
        jp2.add(jtf);
        jp2.add(jl4);
        jp2.add(jl3);
        jp2.add(jpf);
        jp2.add(jl5);
        jp3.add(jt1);
        jp3.add(jt2);


        this.add(jp1,BorderLayout.NORTH);
        this.add(jp2,BorderLayout.CENTER);
        this.add(jp3,BorderLayout.SOUTH);

        this.setTitle("QQ2024");
        this.setLocation(300,200);
        this.setSize(350,200);
        this.setResizable(false);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }

}
